#include <rthw.h>
#include <rtthread.h>
#include "hc32_ddl.h"

#include "w5500.h"


void spi_trx_data(uint8_t * p,uint32_t len)
{
  while(len--)
  {
            while (Reset == SPI_GetFlag(M4_SPI1, SpiFlagSendBufferEmpty))
            {
            }
            /* Send data */
            SPI_SendData8(M4_SPI1, *p);
            /* Wait rx buffer full */
            while (Reset == SPI_GetFlag(M4_SPI1, SpiFlagReceiveBufferFull))
            {
            }
            /* Receive data */
            *p++ = SPI_ReceiveData8(M4_SPI1);
  }
}



